package com.itheima.advantagesup.mapper;

import com.github.pagehelper.Page;
import com.itheima.advantagesup.entity.YddAdvpos;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author iTaotao
 * @date 2023/7/27 15:09
 * @desciption: mapper
 */
@Mapper
public interface YddAdvposMapper {

    /**
     * selete页面
     *
     * @param yddAdvpos ydd advpos
     * @return {@link Page}<{@link YddAdvpos}>
     */
    Page<YddAdvpos> seletePage(YddAdvpos yddAdvpos);

    /**
     * selete列表
     *
     * @return {@link List}<{@link YddAdvpos}>
     */
    @Select("select * from ydd_advpos")
    List<YddAdvpos> seleteList();

    /**
     * 添加advpos
     *
     * @param yddAdvpos ydd advpos
     */
    void addAdvpos(YddAdvpos yddAdvpos);


    /**
     * 删除通过id
     *
     * @param id id
     */
    @Delete("delete from ydd_advpos where id = #{id}")
    void deleteById(Integer id);


    /**
     * selete通过id
     *
     * @param id id
     * @return {@link YddAdvpos}
     */
    @Select("select * from ydd_advpos where id = #{id}")
    YddAdvpos seleteById(Integer id);

    /**
     * 更新advpos
     *
     * @param yddAdvpos ydd advpos
     */
    void updateAdvpos(YddAdvpos yddAdvpos);
}
